package com

import org.apache.spark.{SparkConf, SparkContext}

object WordCount {
  def main(args: Array[String]): Unit = {
     val conf =new SparkConf();
     conf.setAppName("wordcount")
     conf.setMaster("local[*]")
     val sc  =new SparkContext(conf)
      sc.textFile("input/1.txt").flatMap(_.split(" "))
      .map((_,1)).reduceByKey((_+_)).saveAsTextFile("result");
    println("Hello, World!")


  }
}
